package com.wicket.okrpbff.web.contorller;

import com.wicket.okrpbff.biz.service.BusinessObjectService;
import com.wicket.okrpbff.biz.service.dto.req.*;
import com.wicket.okrpbff.biz.service.dto.res.*;
import com.wicket.okrpbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBaseBusinessObjectClient;
import com.wicket.okrframework.integration.dto.AddBizObjectRespDto;
import com.wicket.okrframework.integration.dto.AddBizObjectReqDto;
import com.wicket.okrpbff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.UpdateBizObjectRespDto;
import com.wicket.okrframework.integration.dto.UpdateBizObjectReqDto;
import com.wicket.okrframework.integration.dto.QueryBizObjectListRespDto;
import com.wicket.okrframework.integration.dto.QueryBizObjectListReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryInductionRecordListComReqDto;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrframework.integration.dto.QueryBizObjectDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryBizObjectDetailReqDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComReqDto;
import com.wicket.okrframework.integration.dto.AddObjAttributeRespDto;
import com.wicket.okrframework.integration.dto.AddObjAttributeReqDto;
import com.wicket.okrframework.integration.dto.QueryObjAttributeListRespDto;
import com.wicket.okrframework.integration.dto.QueryObjAttributeListReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffBaseMetadataObjectPropertyDto;
import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrframework.integration.dto.UpdateObjAttributeRespDto;
import com.wicket.okrframework.integration.dto.UpdateObjAttributeReqDto;
import com.wicket.okrframework.integration.dto.BatchQueryBizObjectListRespDto;
import com.wicket.okrframework.integration.dto.BatchQueryBizObjectListReqDto;
import com.wicket.okrframework.integration.dto.QueryObjAttributeDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryObjAttributeDetailReqDto;
import com.wicket.okrframework.integration.dto.AddObjTypeRelationRespDto;
import com.wicket.okrframework.integration.dto.AddObjTypeRelationReqDto;
import com.wicket.okrframework.integration.dto.UpdateObjTypeRelationRespDto;
import com.wicket.okrframework.integration.dto.UpdateObjTypeRelationReqDto;
import com.wicket.okrframework.integration.dto.QueryObjTypeRelationListRespDto;
import com.wicket.okrframework.integration.dto.QueryObjTypeRelationListReqDto;
import com.wicket.okrpbff.biz.service.dto.common.BffObjectPropertyDto;

/**
 * @author ：
 * @date ：
 *
 * 
 * @version 1.0
 */
@Api(value = "BusinessObject", tags = {"BusinessObject"})
@RestController
// @RequestMapping("/poms/businessObject/")
public class BusinessObjectController {
    @Autowired
    BusinessObjectService businessObjectService;

    /**
   * B1-1新增业务对象（平台）
   * gen by moon at 8/10/2022, 3:39:28 AM
   */
    @PostMapping("/oms/platform/businessObject/addBizObject")
    @ApiOperation(value = "B1-1新增业务对象（平台）", response = OkrResult.class)
    public OkrResult<BffAddBizObjectRespDto> addBizObject(@RequestBody(required=false) @Validated BffAddBizObjectReqDto reqDTO){
        return OkrResult.success(businessObjectService.addBizObject(reqDTO));
    }

    /**
   * B1-1查询业务对象列表（平台）
   * gen by moon at 8/31/2022, 7:28:45 PM
   */
    @PostMapping("/oms/platform/businessObject/queryBizObjectList")
    @ApiOperation(value = "B1-1查询业务对象列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryBizObjectListRespDto> queryBizObjectList(@RequestBody(required=false) @Validated BffQueryBizObjectListReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryBizObjectList(reqDTO));
    }

    /**
   * B1-1查询存档条件对象属性类型关系列表（平台）
   * gen by moon at 8/10/2022, 3:43:03 AM
   */
    @PostMapping("/oms/platform/businessObject/queryArchiveObjTypeRelation")
    @ApiOperation(value = "B1-1查询存档条件对象属性类型关系列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryArchiveObjTypeRelationRespDto> queryArchiveObjTypeRelation(@RequestBody(required=false) @Validated BffQueryArchiveObjTypeRelationReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryArchiveObjTypeRelation(reqDTO));
    }

    /**
   * B1-1查询存档条件对象属性列表
   * gen by moon at 8/10/2022, 3:40:45 AM
   */
    @PostMapping("/oms/platform/businessObject/queryArchiveObjAttribute")
    @ApiOperation(value = "B1-1查询存档条件对象属性列表", response = OkrResult.class)
    public OkrResult<BffQueryArchiveObjAttributeRespDto> queryArchiveObjAttribute(@RequestBody(required=false) @Validated BffQueryArchiveObjAttributeReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryArchiveObjAttribute(reqDTO));
    }

    /**
   * B1-1查询对象属性类型关系列表（平台）
   * gen by moon at 8/10/2022, 3:40:14 AM
   */
    @PostMapping("/oms/platform/businessObject/queryObjTypeRelationList")
    @ApiOperation(value = "B1-1查询对象属性类型关系列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryObjTypeRelationListRespDto> queryObjTypeRelationList(@RequestBody(required=false) @Validated BffQueryObjTypeRelationListReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryObjTypeRelationList(reqDTO));
    }

    /**
   * B1-1修改对象属性类型关系（平台）
   * gen by moon at 8/10/2022, 3:40:12 AM
   */
    @PostMapping("/oms/platform/businessObject/updateObjTypeRelation")
    @ApiOperation(value = "B1-1修改对象属性类型关系（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateObjTypeRelationRespDto> updateObjTypeRelation(@RequestBody(required=false) @Validated BffUpdateObjTypeRelationReqDto reqDTO){
        return OkrResult.success(businessObjectService.updateObjTypeRelation(reqDTO));
    }

    /**
   * B1-1新增对象属性类型关系（平台）
   * gen by moon at 8/10/2022, 3:40:11 AM
   */
    @PostMapping("/oms/platform/businessObject/addObjTypeRelation")
    @ApiOperation(value = "B1-1新增对象属性类型关系（平台）", response = OkrResult.class)
    public OkrResult<BffAddObjTypeRelationRespDto> addObjTypeRelation(@RequestBody(required=false) @Validated BffAddObjTypeRelationReqDto reqDTO){
        return OkrResult.success(businessObjectService.addObjTypeRelation(reqDTO));
    }

    /**
   * B1-1查询枚举字段对象属性详情（平台）
   * gen by moon at 8/10/2022, 3:40:07 AM
   */
    @PostMapping("/oms/platform/businessObject/queryObjAttributeDetail")
    @ApiOperation(value = "B1-1查询枚举字段对象属性详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryObjAttributeDetailRespDto> queryObjAttributeDetail(@RequestBody(required=false) @Validated BffQueryObjAttributeDetailReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryObjAttributeDetail(reqDTO));
    }

    /**
   * B1-1查询枚举字段对象属性列表（平台）
   * gen by moon at 8/10/2022, 3:40:06 AM
   */
    @PostMapping("/oms/platform/businessObject/queryEnumObjAttributeList")
    @ApiOperation(value = "B1-1查询枚举字段对象属性列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryEnumObjAttributeListRespDto> queryEnumObjAttributeList(@RequestBody(required=false) @Validated BffQueryEnumObjAttributeListReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryEnumObjAttributeList(reqDTO));
    }

    /**
   * B1-1修改对象属性（平台）
   * gen by moon at 9/11/2022, 5:19:22 AM
   */
    @PostMapping("/oms/platform/businessObject/updateObjAttribute")
    @ApiOperation(value = "B1-1修改对象属性（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateObjAttributeRespDto> updateObjAttribute(@RequestBody(required=false) @Validated BffUpdateObjAttributeReqDto reqDTO){
        return OkrResult.success(businessObjectService.updateObjAttribute(reqDTO));
    }

    /**
   * B1-1查询对象属性列表（平台）
   * gen by moon at 9/11/2022, 5:19:21 AM
   */
    @PostMapping("/oms/platform/businessObject/queryObjAttributeList")
    @ApiOperation(value = "B1-1查询对象属性列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryObjAttributeListRespDto> queryObjAttributeList(@RequestBody(required=false) @Validated BffQueryObjAttributeListReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryObjAttributeList(reqDTO));
    }

    /**
   * B1-1新增对象属性（平台）
   * gen by moon at 9/2/2022, 3:00:40 PM
   */
    @PostMapping("/oms/platform/businessObject/addObjAttribute")
    @ApiOperation(value = "B1-1新增对象属性（平台）", response = OkrResult.class)
    public OkrResult<BffAddObjAttributeRespDto> addObjAttribute(@RequestBody(required=false) @Validated BffAddObjAttributeReqDto reqDTO){
        return OkrResult.success(businessObjectService.addObjAttribute(reqDTO));
    }

    /**
   * B1-1查询业务对象详情（平台）
   * gen by moon at 8/10/2022, 3:39:32 AM
   */
    @PostMapping("/oms/platform/businessObject/queryBizObjectDetail")
    @ApiOperation(value = "B1-1查询业务对象详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryBizObjectDetailRespDto> queryBizObjectDetail(@RequestBody(required=false) @Validated BffQueryBizObjectDetailReqDto reqDTO){
        return OkrResult.success(businessObjectService.queryBizObjectDetail(reqDTO));
    }

    /**
   * B1-1修改业务对象（平台）
   * gen by moon at 8/10/2022, 3:39:29 AM
   */
    @PostMapping("/oms/platform/businessObject/updateBizObject")
    @ApiOperation(value = "B1-1修改业务对象（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateBizObjectRespDto> updateBizObject(@RequestBody(required=false) @Validated BffUpdateBizObjectReqDto reqDTO){
        return OkrResult.success(businessObjectService.updateBizObject(reqDTO));
    }

}

